home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Libraries / Asl.i < prev    next >
Text File  |  1994-12-04  |  17KB  |  412 lines

  1.  
  2. {$I   "Include:Exec/Lists.i"}
  3. {$I   "Include:Exec/Libraries.i"}
  4. {$I   "Include:Utility/Hooks.i"}
  5. {$I   "Include:Utility/TagItem.i"}
  6. {$I   "Include:Workbench/Startup.i"}
  7. {$I   "Include:Graphics/Text.i"}
  8. {$I   "Include:Graphics/DisplayInfo.i"}
  9.  
  10. {************************************************************************}
  11.  
  12. CONST
  13.   AslName    =     "asl.library";
  14.   ASL_TB     =     TAG_USER+$80000;
  15.  
  16. {************************************************************************}
  17.  
  18. { Types of requesters known to ASL, used as arguments to AllocAslRequest() }
  19.   ASL_FileRequest       = 0;
  20.   ASL_FontRequest       = 1;
  21.   ASL_ScreenModeRequest = 2;
  22.  
  23.  
  24. {****************************************************************************
  25.  *
  26.  * ASL File Requester data structures and constants
  27.  *
  28.  * This structure must only be allocated by asl.library amd is READ-ONLY!
  29.  * Control of the various fields is provided via tags when the requester
  30.  * is created with AllocAslRequest() and when it is displayed via
  31.  * AslRequest()
  32.  }
  33.  
  34. type
  35.        FileRequester = Record
  36.         rf_Reserved0   : Array[0..3] of Byte;
  37.         rf_File        : String;        { Filename pointer             }
  38.         rf_Dir         : String;        { Directory name pointer       }
  39.         rf_Reserved1   : Array[0..9] of Byte;
  40.         rf_LeftEdge,rf_TopEdge,         { Preferred window pos }
  41.         rf_Width,rf_Height : WORD;      { Preferred window size  }
  42.         rf_Reserved2   : Array[0..1] of Byte;
  43.         rf_NumArgs     : Integer;       { A-la WB Args, for multiselects }
  44.         rf_ArgList     : WBArgListPtr;
  45.         rf_UserData    : Address;       { Applihandle (you may write!!) }
  46.         rf_Reserved3   : Array[0..7] of Byte;
  47.         rf_Pat         : String;      { Pattern match pointer }
  48.        END;                           { note - more reserved fields follow }
  49.        FileRequesterPtr = ^FileRequester;
  50.  
  51. { File requester tag values, used by AllocAslRequest() and AslRequest() }
  52.  
  53. const
  54. { Window control }
  55.   ASLFR_Window         = ASL_TB+2 ;  { Parent window                    }
  56.   ASLFR_Screen         = ASL_TB+40;  { Screen to open on if no window   }
  57.   ASLFR_PubScreenName  = ASL_TB+41;  { Name of public screen            }
  58.   ASLFR_PrivateIDCMP   = ASL_TB+42;  { Allocate private IDCMP?          }
  59.   ASLFR_IntuiMsgFunc   = ASL_TB+70;  { Function to handle IntuiMessages }
  60.   ASLFR_SleepWindow    = ASL_TB+43;  { Block input in ASLFR_Window?     }
  61.   ASLFR_UserData       = ASL_TB+52;  { What to put in fr_UserData       }
  62.  
  63. { Text display }
  64.   ASLFR_TextAttr       = ASL_TB+51;  { Text font to use for gadget text }
  65.   ASLFR_Locale         = ASL_TB+50;  { Locale ASL should use for text   }
  66.   ASLFR_TitleText      = ASL_TB+1 ;  { Title of requester               }
  67.   ASLFR_PositiveText   = ASL_TB+18;  { Positive gadget text             }
  68.   ASLFR_NegativeText   = ASL_TB+19;  { Negative gadget text             }
  69.  
  70. { Initial settings }
  71.   ASLFR_InitialLeftEdge= ASL_TB+3 ;  { Initial requester coordinates    }
  72.   ASLFR_InitialTopEdge = ASL_TB+4 ;
  73.   ASLFR_InitialWidth   = ASL_TB+5 ;  { Initial requester dimensions     }
  74.   ASLFR_InitialHeight  = ASL_TB+6 ;
  75.   ASLFR_InitialFile    = ASL_TB+8 ;  { Initial contents of File gadget  }
  76.   ASLFR_InitialDrawer  = ASL_TB+9 ;  { Initial contents of Drawer gadg. }
  77.   ASLFR_InitialPattern = ASL_TB+10;  { Initial contents of Pattern gadg.}
  78.  
  79. { Options }
  80.   ASLFR_Flags1         = ASL_TB+20;  { Option flags                     }
  81.   ASLFR_Flags2         = ASL_TB+22;  { Additional option flags          }
  82.   ASLFR_DoSaveMode     = ASL_TB+44;  { Being used for saving?           }
  83.   ASLFR_DoMultiSelect  = ASL_TB+45;  { Do multi-select?                 }
  84.   ASLFR_DoPatterns     = ASL_TB+46;  { Display a Pattern gadget?        }
  85.  
  86. { Filtering }
  87.   ASLFR_DrawersOnly    = ASL_TB+47;  { Don't display files?             }
  88.   ASLFR_FilterFunc     = ASL_TB+49;  { Function to filter files         }
  89.   ASLFR_RejectIcons    = ASL_TB+60;  { Display .info files?             }
  90.   ASLFR_RejectPattern  = ASL_TB+61;  { Don't display files matching pat }
  91.   ASLFR_AcceptPattern  = ASL_TB+62;  { Accept only files matching pat   }
  92.   ASLFR_FilterDrawers  = ASL_TB+63;  { Also filter drawers with patterns}
  93.   ASLFR_HookFunc       = ASL_TB+7 ;  { Combined callback function       }
  94.  
  95. { Flag bits for the ASLFR_Flags1 tag }
  96.   FRB_FILTERFUNC     = 7;
  97.   FRB_INTUIFUNC      = 6;
  98.   FRB_DOSAVEMODE     = 5;
  99.   FRB_PRIVATEIDCMP   = 4;
  100.   FRB_DOMULTISELECT  = 3;
  101.   FRB_DOPATTERNS     = 0;
  102.  
  103.   FRF_FILTERFUNC     = 128;
  104.   FRF_INTUIFUNC      = 64;
  105.   FRF_DOSAVEMODE     = 32;
  106.   FRF_PRIVATEIDCMP   = 16;
  107.   FRF_DOMULTISELECT  = 8;
  108.   FRF_DOPATTERNS     = 1;  
  109.  
  110. { Flag bits for the ASLFR_Flags2 tag }
  111.   FRB_DRAWERSONLY    = 0;
  112.   FRB_FILTERDRAWERS  = 1;
  113.   FRB_REJECTICONS    = 2;
  114.  
  115.   FRF_DRAWERSONLY    = 1;
  116.   FRF_FILTERDRAWERS  = 2;
  117.   FRF_REJECTICONS    = 4;
  118.  
  119.  
  120. {****************************************************************************
  121.  *
  122.  * ASL Font Requester data structures and constants
  123.  *
  124.  * This structure must only be allocated by asl.library amd is READ-ONLY!
  125.  * Control of the various fields is provided via tags when the requester
  126.  * is created with AllocAslRequest() and when it is displayed via
  127.  * AslRequest()
  128.  }
  129. Type
  130.  FontRequester = Record
  131.     fo_Reserved0        : Array[0..7] of Byte;
  132.     fo_Attr             : TextAttr;             { Returned TextAttr                }
  133.     fo_FrontPen,                                { Returned front pen               }
  134.     fo_BackPen,                                 { Returned back pen                }
  135.     fo_DrawMode         : Byte;                 { Returned drawing mode            }
  136.     fo_Reserved1        : Byte;
  137.     fo_UserData         : APTR;                 { You can store your own data here }
  138.     fo_LeftEdge,                                { Coordinates of requester on exit }
  139.     fo_TopEdge,
  140.     fo_Width,
  141.     fo_Height           : WORD;
  142.     fo_TAttr            : TTextAttr;            { Returned TTextAttr               }
  143.  end;
  144.  FontRequesterPtr = ^FontRequester;
  145.  
  146. { Font requester tag values, used by AllocAslRequest() and AslRequest() }
  147.  
  148. const
  149. { Window control }
  150.   ASLFO_Window         = ASL_TB+2 ;  { Parent window                    }
  151.   ASLFO_Screen         = ASL_TB+40;  { Screen to open on if no window   }
  152.   ASLFO_PubScreenName  = ASL_TB+41;  { Name of public screen            }
  153.   ASLFO_PrivateIDCMP   = ASL_TB+42;  { Allocate private IDCMP?          }
  154.   ASLFO_IntuiMsgFunc   = ASL_TB+70;  { Function to handle IntuiMessages }
  155.   ASLFO_SleepWindow    = ASL_TB+43;  { Block input in ASLFO_Window?     }
  156.   ASLFO_UserData       = ASL_TB+52;  { What to put in fo_UserData       }
  157.  
  158. { Text display }
  159.   ASLFO_TextAttr       = ASL_TB+51;  { Text font to use for gadget text }
  160.   ASLFO_Locale         = ASL_TB+50;  { Locale ASL should use for text   }
  161.   ASLFO_TitleText      = ASL_TB+1 ;  { Title of requester               }
  162.   ASLFO_PositiveText   = ASL_TB+18;  { Positive gadget text             }
  163.   ASLFO_NegativeText   = ASL_TB+19;  { Negative gadget text             }
  164.  
  165. { Initial settings }
  166.   ASLFO_InitialLeftEdge= ASL_TB+3 ;  { Initial requester coordinates    }
  167.   ASLFO_InitialTopEdge = ASL_TB+4 ;
  168.   ASLFO_InitialWidth   = ASL_TB+5 ;  { Initial requester dimensions     }
  169.   ASLFO_InitialHeight  = ASL_TB+6 ;
  170.   ASLFO_InitialName    = ASL_TB+10;  { Initial contents of Name gadget  }
  171.   ASLFO_InitialSize    = ASL_TB+11;  { Initial contents of Size gadget  }
  172.   ASLFO_InitialStyle   = ASL_TB+12;  { Initial font style               }
  173.   ASLFO_InitialFlags   = ASL_TB+13;  { Initial font flags for TextAttr  }
  174.   ASLFO_InitialFrontPen= ASL_TB+14;  { Initial front pen                }
  175.   ASLFO_InitialBackPen = ASL_TB+15;  { Initial back pen                 }
  176.   ASLFO_InitialDrawMode= ASL_TB+59;  { Initial draw mode                }
  177.  
  178. { Options }
  179.   ASLFO_Flags          = ASL_TB+20;  { Option flags                     }
  180.   ASLFO_DoFrontPen     = ASL_TB+44;  { Display Front color selector?    }
  181.   ASLFO_DoBackPen      = ASL_TB+45;  { Display Back color selector?     }
  182.   ASLFO_DoStyle        = ASL_TB+46;  { Display Style checkboxes?        }
  183.   ASLFO_DoDrawMode     = ASL_TB+47;  { Display DrawMode cycle gadget?   }
  184.  
  185. { Filtering }
  186.   ASLFO_FixedWidthOnly = ASL_TB+48;  { Only allow fixed-width fonts?    }
  187.   ASLFO_MinHeight      = ASL_TB+16;  { Minimum font height to display   }
  188.   ASLFO_MaxHeight      = ASL_TB+17;  { Maximum font height to display   }
  189.   ASLFO_FilterFunc     = ASL_TB+49;  { Function to filter fonts         }
  190.   ASLFO_HookFunc       = ASL_TB+7 ;  { Combined callback function       }
  191.   ASLFO_MaxFrontPen    = ASL_TB+66;  { Max # of colors in front palette }
  192.   ASLFO_MaxBackPen     = ASL_TB+67;  { Max # of colors in back palette  }
  193.  
  194. { Custom additions }
  195.   ASLFO_ModeList       = ASL_TB+21;  { Substitute list for drawmodes    }
  196.   ASLFO_FrontPens      = ASL_TB+64;  { Color table for front pen palette}
  197.   ASLFO_BackPens       = ASL_TB+65;  { Color table for back pen palette }
  198.  
  199. { Flag bits for ASLFO_Flags tag }
  200.   FOB_DOFRONTPEN    =  0;
  201.   FOB_DOBACKPEN     =  1;
  202.   FOB_DOSTYLE       =  2;
  203.   FOB_DODRAWMODE    =  3;
  204.   FOB_FIXEDWIDTHONLY=  4;
  205.   FOB_PRIVATEIDCMP  =  5;
  206.   FOB_INTUIFUNC     =  6;
  207.   FOB_FILTERFUNC    =  7;
  208.  
  209.   FOF_DOFRONTPEN     = 1;
  210.   FOF_DOBACKPEN      = 2;
  211.   FOF_DOSTYLE        = 4;
  212.   FOF_DODRAWMODE     = 8;
  213.   FOF_FIXEDWIDTHONLY = 16;
  214.   FOF_PRIVATEIDCMP   = 32;
  215.   FOF_INTUIFUNC      = 64;
  216.   FOF_FILTERFUNC     = 128;
  217.  
  218. {****************************************************************************
  219.  *
  220.  * ASL Screen Mode Requester data structures and constants
  221.  *
  222.  * This structure must only be allocated by asl.library and is READ-ONLY!
  223.  * Control of the various fields is provided via tags when the requester
  224.  * is created with AllocAslRequest() and when it is displayed via
  225.  * AslRequest()
  226.  }
  227. Type
  228.  ScreenModeRequester = Record
  229.     sm_DisplayID        : Integer;  { Display mode ID                  }
  230.     sm_DisplayWidth,                { Width of display in pixels       }
  231.     sm_DisplayHeight    : Integer;  { Height of display in pixels      }
  232.     sm_DisplayDepth,                { Number of bit-planes of display  }
  233.     sm_OverscanType     : WORD;     { Type of overscan of display      }
  234.     sm_AutoScroll       : Boolean;  { Display should auto-scroll?      }
  235.  
  236.     sm_BitMapWidth,                 { Used to create your own BitMap   }
  237.     sm_BitMapHeight     : Integer;
  238.  
  239.     sm_LeftEdge,                    { Coordinates of requester on exit }
  240.     sm_TopEdge,
  241.     sm_Width,
  242.     sm_Height           : WORD;
  243.  
  244.     sm_InfoOpened       : Boolean;  { Info window opened on exit?      }
  245.     sm_InfoLeftEdge,                { Last coordinates of Info window  }
  246.     sm_InfoTopEdge,
  247.     sm_InfoWidth,
  248.     sm_InfoHeight       : WORD;
  249.  
  250.     sm_UserData         : APTR;     { You can store your own data here }
  251.  end;
  252.  ScreenModeRequesterPtr = ^ScreenModeRequester;
  253.  
  254. { An Exec list of custom modes can be added to the list of available modes.
  255.  * The DimensionInfo structure must be completely initialized, including the
  256.  * Header. See <graphics/displayinfo.h>. Custom mode ID's must be in the range
  257.  * $FFFF0000..$FFFFFFFF. Regular properties which apply to your custom modes
  258.  * can be added in the dn_PropertyFlags field. Custom properties are not
  259.  * allowed.
  260.  }
  261.  DisplayMode = Record
  262.     dm_Node     : Node;                 { see ln_Name           }
  263.     dm_DimensionInfo : DimensionInfo;   { mode description      }
  264.     dm_PropertyFlags : Integer;         { applicable properties }
  265.  end;
  266.  DisplayModePtr = ^DisplayMode;
  267.  
  268. { ScreenMode requester tag values, used by AllocAslRequest() and AslRequest() }
  269. const
  270. { Window control }
  271.   ASLSM_Window        =  ASL_TB+2 ;  { Parent window                    }
  272.   ASLSM_Screen        =  ASL_TB+40;  { Screen to open on if no window   }
  273.   ASLSM_PubScreenName =  ASL_TB+41;  { Name of public screen            }
  274.   ASLSM_PrivateIDCMP  =  ASL_TB+42;  { Allocate private IDCMP?          }
  275.   ASLSM_IntuiMsgFunc  =  ASL_TB+70;  { Function to handle IntuiMessages }
  276.   ASLSM_SleepWindow   =  ASL_TB+43;  { Block input in ASLSM_Window?     }
  277.   ASLSM_UserData      =  ASL_TB+52;  { What to put in sm_UserData       }
  278.  
  279. { Text display }
  280.   ASLSM_TextAttr      =  ASL_TB+51;  { Text font to use for gadget text }
  281.   ASLSM_Locale        =  ASL_TB+50;  { Locale ASL should use for text   }
  282.   ASLSM_TitleText     =  ASL_TB+1 ;  { Title of requester               }
  283.   ASLSM_PositiveText  =  ASL_TB+18;  { Positive gadget text             }
  284.   ASLSM_NegativeText  =  ASL_TB+19;  { Negative gadget text             }
  285.  
  286. { Initial settings }
  287.   ASLSM_InitialLeftEdge      = ASL_TB+3  ; { Initial requester coordinates    }
  288.   ASLSM_InitialTopEdge       = ASL_TB+4  ;
  289.   ASLSM_InitialWidth         = ASL_TB+5  ; { Initial requester dimensions     }
  290.   ASLSM_InitialHeight        = ASL_TB+6  ;
  291.   ASLSM_InitialDisplayID     = ASL_TB+100; { Initial display mode id     }
  292.   ASLSM_InitialDisplayWidth  = ASL_TB+101; { Initial display width       }
  293.   ASLSM_InitialDisplayHeight = ASL_TB+102; { Initial display height      }
  294.   ASLSM_InitialDisplayDepth  = ASL_TB+103; { Initial display depth       }
  295.   ASLSM_InitialOverscanType  = ASL_TB+104; { Initial type of overscan    }
  296.   ASLSM_InitialAutoScroll    = ASL_TB+105; { Initial autoscroll setting  }
  297.   ASLSM_InitialInfoOpened    = ASL_TB+106; { Info wndw initially opened? }
  298.   ASLSM_InitialInfoLeftEdge  = ASL_TB+107; { Initial Info window coords. }
  299.   ASLSM_InitialInfoTopEdge   = ASL_TB+108;
  300.  
  301. { Options }
  302.   ASLSM_DoWidth         = ASL_TB+109;  { Display Width gadget?           }
  303.   ASLSM_DoHeight        = ASL_TB+110;  { Display Height gadget?          }
  304.   ASLSM_DoDepth         = ASL_TB+111;  { Display Depth gadget?           }
  305.   ASLSM_DoOverscanType  = ASL_TB+112;  { Display Overscan Type gadget?   }
  306.   ASLSM_DoAutoScroll    = ASL_TB+113;  { Display AutoScroll gadget?      }
  307.  
  308. { Filtering }
  309.   ASLSM_PropertyFlags   = ASL_TB+114;  { Must have these Property flags  }
  310.   ASLSM_PropertyMask    = ASL_TB+115;  { Only these should be looked at  }
  311.   ASLSM_MinWidth        = ASL_TB+116;  { Minimum display width to allow  }
  312.   ASLSM_MaxWidth        = ASL_TB+117;  { Maximum display width to allow  }
  313.   ASLSM_MinHeight       = ASL_TB+118;  { Minimum display height to allow }
  314.   ASLSM_MaxHeight       = ASL_TB+119;  { Maximum display height to allow }
  315.   ASLSM_MinDepth        = ASL_TB+120;  { Minimum display depth           }
  316.   ASLSM_MaxDepth        = ASL_TB+121;  { Maximum display depth           }
  317.   ASLSM_FilterFunc      = ASL_TB+122;  { Function to filter mode id's    }
  318.  
  319. { Custom additions }
  320.   ASLSM_CustomSMList    = ASL_TB+123;  { Exec list of struct DisplayMode }
  321.  
  322.  
  323. {****************************************************************************
  324.  *
  325.  * Obsolete ASL definitions, here for source code compatibility only.
  326.  * Please do NOT use in new code.
  327.  *
  328.  *   ASL_V38_NAMES_ONLY to remove these older names
  329.  }
  330. Const
  331.   ASL_Dummy       = (TAG_USER + $80000);
  332.   ASL_Hail        = ASL_Dummy+1 ;
  333.   ASL_Window      = ASL_Dummy+2 ;
  334.   ASL_LeftEdge    = ASL_Dummy+3 ;
  335.   ASL_TopEdge     = ASL_Dummy+4 ;
  336.   ASL_Width       = ASL_Dummy+5 ;
  337.   ASL_Height      = ASL_Dummy+6 ;
  338.   ASL_HookFunc    = ASL_Dummy+7 ;
  339.   ASL_File        = ASL_Dummy+8 ;
  340.   ASL_Dir         = ASL_Dummy+9 ;
  341.   ASL_FontName    = ASL_Dummy+10;
  342.   ASL_FontHeight  = ASL_Dummy+11;
  343.   ASL_FontStyles  = ASL_Dummy+12;
  344.   ASL_FontFlags   = ASL_Dummy+13;
  345.   ASL_FrontPen    = ASL_Dummy+14;
  346.   ASL_BackPen     = ASL_Dummy+15;
  347.   ASL_MinHeight   = ASL_Dummy+16;
  348.   ASL_MaxHeight   = ASL_Dummy+17;
  349.   ASL_OKText      = ASL_Dummy+18;
  350.   ASL_CancelText  = ASL_Dummy+19;
  351.   ASL_FuncFlags   = ASL_Dummy+20;
  352.   ASL_ModeList    = ASL_Dummy+21;
  353.   ASL_ExtFlags1   = ASL_Dummy+22;
  354.   ASL_Pattern     = ASL_FontName;
  355. { remember what I said up there? Do not use these anymore! }
  356.   FILB_DOWILDFUNC  = 7;
  357.   FILB_DOMSGFUNC   = 6;
  358.   FILB_SAVE        = 5;
  359.   FILB_NEWIDCMP    = 4;
  360.   FILB_MULTISELECT = 3;
  361.   FILB_PATGAD      = 0;
  362.   FILF_DOWILDFUNC  = 128;
  363.   FILF_DOMSGFUNC   = 64;
  364.   FILF_SAVE        = 32;
  365.   FILF_NEWIDCMP    = 16;
  366.   FILF_MULTISELECT = 8;
  367.   FILF_PATGAD      = 1;
  368.   FIL1B_NOFILES    = 0;
  369.   FIL1B_MATCHDIRS  = 1;
  370.   FIL1F_NOFILES    = 1;
  371.   FIL1F_MATCHDIRS  = 2;
  372.   FONB_FRONTCOLOR  = 0;
  373.   FONB_BACKCOLOR   = 1;
  374.   FONB_STYLES      = 2;
  375.   FONB_DRAWMODE    = 3;
  376.   FONB_FIXEDWIDTH  = 4;
  377.   FONB_NEWIDCMP    = 5;
  378.   FONB_DOMSGFUNC   = 6;
  379.   FONB_DOWILDFUNC  = 7;
  380.   FONF_FRONTCOLOR  = 1;
  381.   FONF_BACKCOLOR   = 2;
  382.   FONF_STYLES      = 4;
  383.   FONF_DRAWMODE    = 8;
  384.   FONF_FIXEDWIDTH  = 16;
  385.   FONF_NEWIDCMP    = 32;
  386.   FONF_DOMSGFUNC   = 64;
  387.   FONF_DOWILDFUNC  = 128;
  388.  
  389.  
  390. {***************************************************************************}
  391.  
  392.  
  393. FUNCTION AllocAslRequest(Typ : Integer; TagList : Address) : Address;
  394.     External;
  395.  
  396. FUNCTION AllocFileRequest : FileRequesterPtr;
  397.     External;
  398.  
  399. FUNCTION AslRequest(Req : Address; TagList : Address) : Boolean;
  400.     External;
  401.  
  402. PROCEDURE FreeAslRequest(Req : Address);
  403.     External;
  404.  
  405. PROCEDURE FreeFileRequest(Req : FileRequesterPtr);
  406.     External;
  407.  
  408. FUNCTION RequestFile(Req : FIleRequesterPtr) : Boolean;
  409.     External;
  410.  
  411.  
  412.